﻿using IServices;
using Microsoft.AspNetCore.Mvc;
using NDLS.WebApi.Model.ModelVM;
using NDLS.WebApi.Model;
using Microsoft.AspNetCore.Authorization;

namespace NDLS.WebApi.Controllers
{
    /// <summary>
    /// 课程相关操作
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class CourseController : Controller
    {
        private readonly IUserService _userService;

        /// <summary>
        /// 依赖注入
        /// </summary>
        /// <param name="userService"></param>

        public CourseController(IUserService userService)
        {
            _userService = userService;
        }


        /// <summary>
        /// 添加课程信息
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [Authorize(Policy = "Admin")]
        public MsgRes AddCourse(ClassInfo classInfo)
        {
            return _userService.AddCourse(classInfo);
        }


    }
}

